/**************************************************************************
 * Copyright (C) 2012 Tyler Robertson
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **************************************************************************/

#ifndef __SPI_H__
#define __SPI_H__


void spi_initialize();

void spi_read_array( unsigned char *array, unsigned long num_bytes );
void spi_write_array( const unsigned char *array, unsigned long num_bytes );

unsigned char spi_transfer_byte( volatile unsigned char data );
unsigned char spi_read_byte();
void spi_write_byte( unsigned char data );

void spi_select_slave( unsigned char slave );
void spi_deselect_slave( unsigned char slave );

#endif /* __SPI_H__ */
